3.2.82 \(\int \frac {1}{a+a \tan ^2(c+d x)} \, dx\) [182]

Optimal. Leaf size=31 \[ \frac {x}{2 a}+\frac {\cos (c+d x) \sin (c+d x)}{2 a d} \]

[Out]

1/2*x/a+1/2*cos(d*x+c)*sin(d*x+c)/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3738, 12, 2715, 8} \begin {gather*} \frac {\sin (c+d x) \cos (c+d x)}{2 a d}+\frac {x}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Tan[c + d*x]^2)^(-1),x]

[Out]

x/(2*a) + (Cos[c + d*x]*Sin[c + d*x])/(2*a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rubi steps

\begin {align*} \int \frac {1}{a+a \tan ^2(c+d x)} \, dx &=\int \frac {\cos ^2(c+d x)}{a} \, dx\\ &=\frac {\int \cos ^2(c+d x) \, dx}{a}\\ &=\frac {\cos (c+d x) \sin (c+d x)}{2 a d}+\frac {\int 1 \, dx}{2 a}\\ &=\frac {x}{2 a}+\frac {\cos (c+d x) \sin (c+d x)}{2 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 26, normalized size = 0.84 \begin {gather*} \frac {2 (c+d x)+\sin (2 (c+d x))}{4 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Tan[c + d*x]^2)^(-1),x]

[Out]

(2*(c + d*x) + Sin[2*(c + d*x)])/(4*a*d)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 38, normalized size = 1.23

method result size
risch \(\frac {x}{2 a}+\frac {\sin \left (2 d x +2 c \right )}{4 a d}\) \(25\)
derivativedivides \(\frac {\frac {\tan \left (d x +c \right )}{2+2 \left (\tan ^{2}\left (d x +c \right )\right )}+\frac {\arctan \left (\tan \left (d x +c \right )\right )}{2}}{d a}\) \(38\)
default \(\frac {\frac {\tan \left (d x +c \right )}{2+2 \left (\tan ^{2}\left (d x +c \right )\right )}+\frac {\arctan \left (\tan \left (d x +c \right )\right )}{2}}{d a}\) \(38\)
norman \(\frac {\frac {x}{2 a}+\frac {\tan \left (d x +c \right )}{2 a d}+\frac {x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}}{1+\tan ^{2}\left (d x +c \right )}\) \(49\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+a*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(1/2*tan(d*x+c)/(1+tan(d*x+c)^2)+1/2*arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 36, normalized size = 1.16 \begin {gather*} \frac {\frac {d x + c}{a} + \frac {\tan \left (d x + c\right )}{a \tan \left (d x + c\right )^{2} + a}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*((d*x + c)/a + tan(d*x + c)/(a*tan(d*x + c)^2 + a))/d

________________________________________________________________________________________

Fricas [A]
time = 4.09, size = 40, normalized size = 1.29 \begin {gather*} \frac {d x \tan \left (d x + c\right )^{2} + d x + \tan \left (d x + c\right )}{2 \, {\left (a d \tan \left (d x + c\right )^{2} + a d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(d*x*tan(d*x + c)^2 + d*x + tan(d*x + c))/(a*d*tan(d*x + c)^2 + a*d)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (22) = 44\).
time = 0.28, size = 87, normalized size = 2.81 \begin {gather*} \begin {cases} \frac {d x \tan ^{2}{\left (c + d x \right )}}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} + \frac {d x}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} + \frac {\tan {\left (c + d x \right )}}{2 a d \tan ^{2}{\left (c + d x \right )} + 2 a d} & \text {for}\: d \neq 0 \\\frac {x}{a \tan ^{2}{\left (c \right )} + a} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)**2),x)

[Out]

Piecewise((d*x*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 + 2*a*d) + d*x/(2*a*d*tan(c + d*x)**2 + 2*a*d) + tan(c +
 d*x)/(2*a*d*tan(c + d*x)**2 + 2*a*d), Ne(d, 0)), (x/(a*tan(c)**2 + a), True))

________________________________________________________________________________________

Giac [A]
time = 0.56, size = 37, normalized size = 1.19 \begin {gather*} \frac {\frac {d x + c}{a} + \frac {\tan \left (d x + c\right )}{{\left (\tan \left (d x + c\right )^{2} + 1\right )} a}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*((d*x + c)/a + tan(d*x + c)/((tan(d*x + c)^2 + 1)*a))/d

________________________________________________________________________________________

Mupad [B]
time = 11.83, size = 26, normalized size = 0.84 \begin {gather*} \frac {\frac {\sin \left (2\,c+2\,d\,x\right )}{4\,a}+\frac {d\,x}{2\,a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a + a*tan(c + d*x)^2),x)

[Out]

(sin(2*c + 2*d*x)/(4*a) + (d*x)/(2*a))/d

________________________________________________________________________________________